package samples.d2.shapes 
{
	import flash.geom.Point;
	import flash.geom.Rectangle;
	import samples.BaseSample;
	import shapes.shapes2D.distribution.Triangular;
	import shapes.shapes2D.polygon.RegularPolygon;
	
	/**
	 * ...
	 * @author Nicolas Barradeau
	 * http://en.nicoptere.net
	 */
	public class RegularPolygon3 extends BaseSample
	{
		
		public function RegularPolygon3( rotate:Boolean = false ) 
		{
			
			
			var radius:Number = 60;
			var points:Vector.<Point> = Triangular.distribute( radius, sw + radius * 2, sh + radius * 2 );
			
			
			var po:RegularPolygon;
			
			for each( var p:Point in points )
			{
				po = new RegularPolygon( p.x, p.y, radius, 3 );
				po.draw();
				if( rotate ) po.rotation = 30;
				addChild( po );
				
			}
			
		}
		
	}

}